package com.sf.fy.uav.common.enums;

import lombok.Getter;

/**
 * 景区状态枚举
 * @author ta136817
 */
@Getter
public enum ScenicSpotStatusEnum {
    /**
     * 景区正常状态
     */
    NORMAL("正常", 0),
    /**
     * 景区关闭状态
     */
    OFF("关闭", 1);
    private String desc;
    private Integer value;

    public void setValue(Integer value) {
        this.value = value;
    }

    ScenicSpotStatusEnum(String desc, Integer value) {
        this.desc = desc;
        this.value = value;
    }


    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDesc(Integer value) {
        for (ScenicSpotStatusEnum ele : values()) {
            if (ele.getValue().equals(value)) {
                return ele.getDesc();
            }
        }
        return null;
    }

    public static String getName(Integer value) {
        for (ScenicSpotStatusEnum ele : values()) {
            if (ele.getValue().equals(value)) {
                return ele.name();
            }
        }
        return null;
    }
}
